﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _20170202_TV
{
    class TV
    {
        private List<Chanel> chanelList;
        private int currentChanel;

        public TV()
        {
            chanelList = new List<Chanel>();
            chanelList.Add(new Chanel("Первый"));
            chanelList.Add(new Chanel("Второй"));
            chanelList.Add(new Chanel("Третий"));
            chanelList.Add(new Chanel("Четвертый"));
        }

        public void SwitchChanelUp()
        {
            if (currentChanel == chanelList.Count - 1)
                currentChanel = 0;
            else
                currentChanel++;
            ShowCurrentChanel();
        }

        public void SwitchChanelDown()
        {
            if (currentChanel == 0)
                currentChanel = chanelList.Count - 1;
            else
                currentChanel--;
            ShowCurrentChanel();
        }

        public void ShowCurrentChanel()
        {
            Console.WriteLine("Включен {0}", chanelList[currentChanel]);
        }

    }
}
